package com.style_transfer.controller;

import com.style_transfer.model.Image;
import com.style_transfer.model.ImageStyle;
import com.style_transfer.model.Location;
import com.style_transfer.model.Style;
import com.style_transfer.service.impl.TransferServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/transfer")
public class TransferController {
    @Autowired
    private TransferServiceImpl transferService;

    @ResponseBody
    @RequestMapping("/getImageStyle")
    public ImageStyle getImageStyle(@RequestBody Image image, @RequestBody Style style) {
        return transferService.getImageStyle(image,style);
    }

    @ResponseBody
    @GetMapping("/getImageStyleByName")
    public ImageStyle getImageStyleByName(@RequestBody Location location, @RequestBody Style style) {
        return transferService.getImageStyleByName(location,style);
    }
}
